<?php if(!defined('OCTOMS')){header('HTTP/1.1 403');die('{"error":"forbidden"}');}
/*
 * @package       Fervoare.com
 * @link          http://Fervoare.com
 * @copyright     Copyright 2011, Valentino-Jivko Radosavlevici (http://valentino.radosavlevici.com)
 * @license       GPL v3.0 (http://www.gnu.org/licenses/gpl-3.0.txt)
 * 
 * Redistributions of files must retain the above copyright notice.
 * 
 * @since         Fervoare.com 0.0.1
 */
	
	/*
	 * Fervoare CMS Installer
	 * 
	 * 
	 * @package Fervoare.com
	 * @version 0.1
	 * 
	 * @author Valentino-Jivko Radosavlevici
	 */
	class install extends octoms
	{
		
		/**
		 * Class constructor
		 * 
		 * 
		 * @param 
		 * @return install
		 * @package Fervoare.com
		 * 
		 * @author Valentino-Jivko Radosavlevici
		 */
		function __construct()
		{
			// Load the input core library
			$this->_('input',OMS_CL);
			
			// Load the model
			$this->_('install',OMS_M,'model');
			
			// Load the template library
			$this->_('template',OMS_L);
			
		}// end function __construct()
		
		/**
		 * Index
		 * 
		 * @example 
		 * 
		 * @param 
		 * @return 
		 * @package Fervoare.com
		 * 
		 * @author Valentino-Jivko Radosavlevici
		 */
		function index()
		{
			// Use jQuery
			$this->template->js(
				array(
					WIZARD.WS.'js'.WS.'common'.WS.'jquery.js',
					WIZARD.WS.'js'.WS.'common'.WS.'jquery-ui.js',
					'custom'=>true
				)
			);
			
			// Use the uniform and tooltip packages; load the jScript init procedures
			$this->template->_jquery(array('uniform','tooltip'),'content','admin')->js(array(sprintf("$(document).ready(function(){\n%s\n});",$this->template->_get1('__jq__')),'remote'=>false));
			
			// Update
			if ($this->input->post())
			{
				if($this->model->update())
				{
					$this->template->_r('admin');
				}
			}
			
			// Load the template
			print $this->view->load('index');
			
		}// end function index()
		
	}// end class install
	
	
/* End Of File <install.inc> */